package com.gd.server.action;

import java.util.UUID;

import com.gd.common.exceptions.BusinessException;
import com.gd.common.net.RequestToServer;
import com.gd.common.net.Response;
import com.gd.common.util.ErrorMessageUtil;
import com.gd.server.service.ServerContext;



public class LogoutAction extends ServerAction{

	@Override
	public void executeSome(RequestToServer request, Response response)
			throws Exception {
		UUID uuid=(UUID)request.getParameter("SessionId");
		if(ServerContext.onlineUsers.containsKey(uuid))
			ServerContext.onlineUsers.remove(uuid);	
		else
			throw new BusinessException(ErrorMessageUtil.getErrorMessage(1010));
		
	}
	
	

}

